Page({

  /**
   * 页面的初始数据
   */
  data: {
    // 轮播图数据
    bannerList: [
      "http://p1.music.126.net/-YVB6msZiPLdUiAZPPeutA==/109951166546494305.jpg",
      "http://p1.music.126.net/4rGh44d7Lub5BeTK0RFSkA==/109951166548699010.jpg",
      "http://p1.music.126.net/A5i9cQ6h0f9NCBYIRyao6A==/109951166548627020.jpg",
      "http://p1.music.126.net/oWxyUjp9rchDgU-nkINGTA==/109951166548298229.jpg",
      "http://p1.music.126.net/_KCrKz5c8yegQG12m1Cplw==/109951166548708038.jpg",
      "http://p1.music.126.net/Xqubem-6-eV4cd6FOBc0FQ==/109951166548937857.jpg"
    ], 
    // 推荐歌单
    recommendList: [
      {"picUrl":"https://p2.music.126.net/lHjRKW5bkXO4ZXy5ShoDFA==/109951165517309896.jpg","name":"“网易云那些评论10万+的歌”"},
      {"picUrl":"https://p2.music.126.net/vkvpjQe0dpEstpsgcjVwzA==/109951166367891845.jpg","name":"我深知这是我一个人的困局."},
      {"picUrl":"https://p2.music.126.net/i-SXaH6t1qpY8KqXyO3D1g==/109951166411177781.jpg","name":"听完这些歌，就该放下你了"},
      {"picUrl":"https://p2.music.126.net/cGMHycB6NoQOu2RLd-r6FA==/109951165878104638.jpg","name":"人间太吵了 来我心里吧"},
      {"picUrl":"https://p2.music.126.net/ElM-OLlwFKb2ZU-2LeVyiA==/109951166270328009.jpg","name":"不知道算是谁的错，两个人变得话不多"},
      {"picUrl":"https://p2.music.126.net/G46gxr_EdRaRQxHZkq4eMw==/109951166517080603.jpg","name":"姜云升全网绝对最全最高质量原声歌单"},
      {"picUrl":"https://p2.music.126.net/yctLm3Qf-0txRD8Bh4dpUA==/109951165423398111.jpg","name":"云音乐·严选评论过十万的歌10w⁺"},
      {"picUrl":"https://p2.music.126.net/GKSrdOFE3n-mLDCNX8hnGA==/109951165727418932.jpg","name":"辣妹日记|糟糕我已经开始辣了"},
      {"picUrl":"https://p2.music.126.net/hSrYgWVp_LKnE2EPZdt_dQ==/109951165779590359.jpg","name":"带上耳机，出车祸别找我"},
      {"picUrl":"https://p2.music.126.net/gafpiWGUhgORf3B6TAVVLA==/109951165795378516.jpg","name":"好听的歌永远没有完整版"}
    ], 
    topList: [], // 排行榜数据
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: async function (options) {
  
   
  },
  
  // 跳转至recommendSong页面的回调
  toRecommendSong(){
    let userInfo = wx.getStorageSync('userInfo')
    if(!userInfo.nickName){
      wx.showToast({
        title: '请先登录!',
        icon:'none'
      })
      setTimeout(()=>{
        wx.switchTab({
          url: '/pages/login/login' 
        })
      },1000)
      // return
    }else{
      wx.navigateTo({
        url: '/pages/list/list'
      })
    }
  },
  // 跳转至other页面
  toOther(){
    wx.navigateTo({
      url: '/songPackage/pages/other/other'
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})
